Column

Distribution of inspection scores by cuisine type

Column

Chart B

Chart C

---
title: "NYC Restaurant Inspections"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(p8105.datasets)
library(plotly)
```

```{r clean_data}
data(rest_inspec)

rest_inspec <-
  rest_inspec %>% 
  select(boro, critical_flag, cuisine_description, score, grade) %>% 
  filter(boro == "STATEN ISLAND",
         !is.na(grade),
         !str_detect(cuisine_description, "[Ww]ater|[Jj]uice|[Cc]offee")) %>% 
  mutate(cuisine_description = recode(cuisine_description, "Latin (Cuban, Dominican, Puerto Rican, South & Central American)" = "Latin"))
```


Column {data-width=650}
-----------------------------------------------------------------------

### Distribution of inspection scores by cuisine type

```{r boxplot}
rest_inspec %>% 
  mutate(cuisine_description = fct_reorder(cuisine_description, score)) %>%
  plot_ly(y = ~score, color = ~cuisine_description, type = "box", colors = "viridis")
```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r histogram}

```

### Chart C

```{r}

```